package cn.yusei.teamTribe.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface PermissionDAO {

	final String ROLE_PERMISSION_TABLE = " r_role_permission ";
	
	@Select({"select permission_id from", ROLE_PERMISSION_TABLE, "where role_id = #{roleId}"})
	public int[] select(@Param("roleId") int roleId);
	
	@Select({"select exists (select * from ", ROLE_PERMISSION_TABLE, "where role_id = #{roleId} and permission_id = #{permissionId})"})
	public boolean exists(PermissionPO teamPermissionPO);
	
}
